home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / cpp.z / cpp
Text File  |  1998-10-30  |  15KB  |  331 lines

  1.  
  2.  
  3.  
  4. CCCCPPPPPPPP((((1111))))                                                                  CCCCPPPPPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cpp - the C language preprocessor
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      LIBDIR/cpp [ option | file ] ...
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _c_p_p is a K&R C language preprocessor designed for standalone use and to
  16.      be invoked as the first pass of all FORTRAN compilations and any K&R mode
  17.      C compilation with the ----mmmmpppp option.  Thus, _c_p_p'_s output is designed to be
  18.      in a form acceptable as input to the next pass of the C compiler.
  19.      Standalone use of _c_p_p on C code is not suggested, since the functionality
  20.      of _c_p_p has been incorporated into the C front-end.  See _m_4(1) for a more
  21.      general macro processor.
  22.  
  23.      This is a K&R C language preprocessor, not an ISO/ANSI C language
  24.      preprocessor: it is useful for those needing the old preprocessor.  The ####
  25.      operator, sometimes called the _s_t_r_i_n_g_i_z_e operator, is not recognized as
  26.      such by _c_p_p.  The ######## operator, sometimes called the _p_a_s_t_i_n_g operator, is
  27.      not recognized as such by _c_p_p.  And the ####eeeelllliiiiffff command is not recognized
  28.      by _c_p_p.  There are other differences between this and  ISO/ANSI C
  29.      preprocessors.
  30.  
  31.      _c_p_p optionally accepts any sequence of flags and input file names.  The
  32.      input files are processed in order; if no input file names are given, the
  33.      standard input is used.  The results of preprocessing the input file(s)
  34.      are sent to the standard output.
  35.  
  36.      The following _o_p_t_i_o_n_s to _c_p_p are recognized:
  37.  
  38.  
  39.      -PPPP      Preprocess the input without producing the line control
  40.              information used by the next pass of the C compiler.
  41.  
  42.      -CCCC      By default, _c_p_p strips C-style comments.  If the ----CCCC option is
  43.              specified, all comments (except those found on _c_p_p directive
  44.              lines) are passed along.
  45.  
  46.      -MMMM      Run only the macro preprocessor on the named C programs,
  47.              requesting it to generate Makefile dependencies and send the
  48.              result to the standard output.
  49.  
  50.      -MMMMDDDDuuuuppppddddaaaatttteeee _f_i_l_e_n_a_m_e
  51.              Similar to the ----MMMM option, but stores the resulting Makefile
  52.              dependencies in _f_i_l_e_n_a_m_e rather than sending them to the standard
  53.              output.  _c_p_p with the ----MMMMDDDDuuuuppppddddaaaatttteeee option updates only the lines in
  54.              _f_i_l_e_n_a_m_e that end with a distinctive make comment and begin with
  55.              the target name (as described under the ----MMMMDDDDttttaaaarrrrggggeeeetttt option)
  56.              followed by a colon.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCPPPPPPPP((((1111))))                                                                  CCCCPPPPPPPP((((1111))))
  71.  
  72.  
  73.  
  74.      -MMMMDDDDttttaaaarrrrggggeeeetttt _n_a_m_e
  75.              When the ----MMMMDDDDuuuuppppddddaaaatttteeee option has been used, this option causes _n_a_m_e
  76.              to be used as the target name for the first source file.  By
  77.              default, the target name for a source file is the same as the
  78.              source file name with a `.o' suffix.
  79.  
  80.      -UUUU_n_a_m_e  Remove any initial definition of _n_a_m_e, where _n_a_m_e is a reserved
  81.              symbol that is predefined by the particular preprocessor.
  82.              Following is the current list of these possibly reserved symbols.
  83.              The symbols ___E_D_G, _s_g_i, _u_n_i_x, and _m_i_p_s are always predefined by
  84.              _c_p_p. The symbol ___E_X_T_E_N_S_I_O_N_S__ is predefined to indicate this is
  85.              not an ANSI cpp and to allow extensions in ANSI C include files.
  86.              The compiler drivers, _a_s(_1), _c_c(1), _C_C(1), _p_c(1), and _f_7_7(1)
  87.              predefine many other symbols during preprocessing.  See their
  88.              respective man pages for complete lists of the symbols that they
  89.              define.
  90.  
  91.  
  92.      -DDDD_n_a_m_e
  93.  
  94.      -DDDD_n_a_m_e=_d_e_f
  95.              Define _n_a_m_e with value _d_e_f as if by a ####ddddeeeeffffiiiinnnneeee.  If no =_d_e_f is
  96.              given, _n_a_m_e is defined with value 1.  The ----DDDD option has lower
  97.              precedence than the ----UUUU option.  That is, if the same name is used
  98.              in both a ----UUUU options and a ----DDDD option, the name will be undefined
  99.              regardless of the order of the options.
  100.  
  101.      -IIII_d_i_r   Change the algorithm for searching for ####iiiinnnncccclllluuuuddddeeee files whose names
  102.              do not begin with / to look in _d_i_r before looking in the
  103.              directories on the standard list.  Thus ####iiiinnnncccclllluuuuddddeeee files whose
  104.              names are enclosed in "" will be searched for first in the
  105.              directory of the file with the ####iiiinnnncccclllluuuuddddeeee line, then in the
  106.              directories named in ----IIII options, and last in directories on a
  107.              standard list.  For ####iiiinnnncccclllluuuuddddeeee files whose names are enclosed in
  108.              <>, the directory of the file with the ####iiiinnnncccclllluuuuddddeeee line is not
  109.              searched.  If ----IIII is given with no _d_i_r, _c_p_p is instructed to
  110.              suppress the search of the standard list of include directories.
  111.              This standard list consists only of /_u_s_r/_i_n_c_l_u_d_e.
  112.  
  113.      -mmmmaaaaxxxx____rrrreeeecccc____ddddeeeepppptttthhhh====_n_u_m
  114.              Set the maximum nesting depth of calls to a single macro to _n_u_m.
  115.              The default value is 300.
  116.  
  117.      Four special names are understood by _c_p_p.  The name ________LLLLIIIINNNNEEEE________ is defined
  118.      as the current line number (as a decimal integer) as known by _c_p_p,
  119.      ________FFFFIIIILLLLEEEE________ is defined as the current file name (as a C string) as known by
  120.      _c_p_p, ________DDDDAAAATTTTEEEE________ is defined as a C string containing the current date
  121.      (printed in the form "Dec 31 1999"), and ________TTTTIIIIMMMMEEEE________ is defined as a C
  122.      string containing the current time in hh:mm:ss format.  They can be used
  123.      anywhere (including in macros) just as any other defined name.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCPPPPPPPP((((1111))))                                                                  CCCCPPPPPPPP((((1111))))
  137.  
  138.  
  139.  
  140.      All _c_p_p directive lines start with #### in column 1.  Any number of blanks
  141.      and tabs are allowed between the #### and the directive.  The directives
  142.      are:
  143.  
  144.  
  145.      ####ddddeeeeffffiiiinnnneeee _n_a_m_e _t_o_k_e_n-_s_t_r_i_n_g
  146.           Replace subsequent instances of _n_a_m_e with _t_o_k_e_n-_s_t_r_i_n_g.
  147.  
  148.      ####ddddeeeeffffiiiinnnneeee _n_a_m_e( _a_r_g, ..., _a_r_g ) _t_o_k_e_n-_s_t_r_i_n_g
  149.           Notice that there can be no space between _n_a_m_e and the (.  Replace
  150.           subsequent instances of _n_a_m_e followed by a (, a list of comma-
  151.           separated sets of tokens, and a ) followed by _t_o_k_e_n-_s_t_r_i_n_g, where
  152.           each occurrence of an _a_r_g in the _t_o_k_e_n-_s_t_r_i_n_g is replaced by the
  153.           corresponding set of tokens in the comma-separated list.  When a
  154.           macro with arguments is expanded, the arguments are placed into the
  155.           expanded _t_o_k_e_n-_s_t_r_i_n_g unchanged.  After the entire _t_o_k_e_n-_s_t_r_i_n_g has
  156.           been expanded, _c_p_p re-starts its scan for names to expand at the
  157.           beginning of the newly created _t_o_k_e_n-_s_t_r_i_n_g.
  158.  
  159.      ####uuuunnnnddddeeeeffff _n_a_m_e
  160.           Cause the definition of _n_a_m_e (if any) to be forgotten from now on.
  161.           No additional tokens are permitted on the directive line after _n_a_m_e.
  162.  
  163.      ####iiiiddddeeeennnntttt "_s_t_r_i_n_g"
  164.           The _s_t_r_i_n_g and the directive are silently swallowed.  No output is
  165.           produced for this directive.
  166.  
  167.      ####pppprrrraaaaggggmmmmaaaa
  168.           The directive and whatever follows it on the line is passed to the
  169.           output in a slightly modified form which is not documented.  The
  170.           form may change in a future release.
  171.  
  172.      ####pppprrrraaaaggggmmmmaaaa oooonnnncccceeee
  173.           If this directive appears in an included file, the file will never
  174.           be included again, even if there is another ####iiiinnnncccclllluuuuddddeeee of this file.
  175.           No tokens or comments are permitted after the ``once'' keyword.
  176.           Using ####pppprrrraaaaggggmmmmaaaa oooonnnncccceeee is more efficient than using macro wrappers,
  177.           because the included file is not rescanned, but it may not be
  178.           portable to third-party preprocessors.
  179.  
  180.      ####iiiinnnncccclllluuuuddddeeee "_f_i_l_e_n_a_m_e"
  181.  
  182.      ####iiiinnnncccclllluuuuddddeeee <_f_i_l_e_n_a_m_e>
  183.           Include at this point the contents of _f_i_l_e_n_a_m_e (which will then be
  184.           run through _c_p_p).  When the <_f_i_l_e_n_a_m_e> notation is used, _f_i_l_e_n_a_m_e is
  185.           only searched for in the standard places.  See the ----IIII option above
  186.           for more detail.  No additional tokens are permitted on the
  187.           directive line after the final " or >.
  188.  
  189.      ####lllliiiinnnneeee _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t _f_i_l_e_n_a_m_e
  190.           Causes _c_p_p to generate line control information for the next pass of
  191.           the C compiler.  _I_n_t_e_g_e_r-_c_o_n_s_t_a_n_t is the line number of the next
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCPPPPPPPP((((1111))))                                                                  CCCCPPPPPPPP((((1111))))
  203.  
  204.  
  205.  
  206.           line and _f_i_l_e_n_a_m_e is the file from which it comes.  If "_f_i_l_e_n_a_m_e" is
  207.           not given, the current file name is unchanged.  No additional tokens
  208.           are premitted on the directive line after the optional _f_i_l_e_n_a_m_e.
  209.  
  210.      ####eeeennnnddddiiiiffff
  211.           Ends a section of lines begun by a test directive (####iiiiffff,,,, ####iiiiffffddddeeeeffff, or
  212.           ####iiiiffffnnnnddddeeeeffff).  Each test directive must have a matching ####eeeennnnddddiiiiffff. No
  213.           additional tokens are permitted on the directive line.
  214.  
  215.      ####iiiiffffddddeeeeffff _n_a_m_e
  216.           The lines following will appear in the output if and only if _n_a_m_e
  217.           has been the subject of a previous ####ddddeeeeffffiiiinnnneeee without being the subject
  218.           of an intervening ####uuuunnnnddddeeeeffff.  No additional tokens are permitted on the
  219.           directive line after _n_a_m_e.
  220.  
  221.      ####iiiiffffnnnnddddeeeeffff _n_a_m_e
  222.           The lines following will appear in the output if and only if _n_a_m_e
  223.           has not been the subject of a previous ####ddddeeeeffffiiiinnnneeee.  No additional
  224.           tokens are permitted on the directive line after _n_a_m_e.
  225.  
  226.      ####iiiiffff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  227.           Lines following will appear in the output if and only if the
  228.           _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n evaluates to non-zero.  All binary non-
  229.           assignment C operators, the ?: operator, the unary -, !, and ~
  230.           operators are all legal in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  The precedence of
  231.           the operators is the same as defined by the C language. There is
  232.           also a unary operator ddddeeeeffffiiiinnnneeeedddd, which can be used in _c_o_n_s_t_a_n_t-
  233.           _e_x_p_r_e_s_s_i_o_n in these two forms: ddddeeeeffffiiiinnnneeeedddd (((( _n_a_m_e )))) or ddddeeeeffffiiiinnnneeeedddd _n_a_m_e.
  234.           This allows the utility of ####iiiiffffddddeeeeffff and ####iiiiffffnnnnddddeeeeffff in a ####iiiiffff directive.
  235.           Only these operators, integer constants, and names which are known
  236.           by _c_p_p should be used in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  In particular, the
  237.           ssssiiiizzzzeeeeooooffff operator is not available.
  238.  
  239.           To test whether either of two symbols, _f_o_o and _f_u_m, are defined,
  240.           use:
  241.                #if defined(foo) || defined(fum)
  242.  
  243.      ####eeeellllsssseeee
  244.           The lines following will appear in the output if and only if the
  245.           preceding test directive evaluates to zero.  No additional tokens
  246.           are permitted on the directive line.
  247.  
  248.      The test directives and the possible ####eeeellllsssseeee directives can be nested.
  249.  
  250. FFFFIIIILLLLEEEESSSS
  251.      _I_N_C_D_I_R         standard directory list for ####iiiinnnncccclllluuuuddddeeee files,
  252.                /usr/include
  253.  
  254.      _L_I_B_D_I_R         /usr/lib
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCPPPPPPPP((((1111))))                                                                  CCCCPPPPPPPP((((1111))))
  269.  
  270.  
  271.  
  272. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.      cc(1), line(1), m4(1), unifdef(1)
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.